package com.codeplay.repository;

import com.codeplay.entity.Course;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface CourseRepository extends JpaRepository<Course, Long> {
    Page<Course> findByDifficultyLevel(Course.DifficultyLevel difficultyLevel, Pageable pageable);
    Page<Course> findByAgeRange(String ageRange, Pageable pageable);
    List<Course> findByCreatedById(Long createdById);
    Page<Course> findByTitleContainingIgnoreCase(String title, Pageable pageable);
} 